package com.example.mybatisplusexamples.controller;

import com.example.mybatisplusexamples.domain.User;
import com.example.mybatisplusexamples.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("hi")
    public String hi(String name) {
        System.out.println(name);

        System.out.println(("----- selectAll method test ------"));
        List<User> userList = userMapper.selectList(null);
        userList.forEach(System.out::println);

        return "hi " + name;
    }
}
